<template>
  <div id="app">
    <router-view />
  </div>

  <com-detail ref="detailView" />

</template>

<script>
import { defineComponent, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import comDetail from '@CRM/components/comDetailView/template.vue'

export default defineComponent({
  name: 'App',
  components: { comDetail },
  setup(proxy) {
    const detailView = ref(null)

    const route = useRoute()
    watch(route, (newValue, oldValue) => {
      // 直接监听
      if (detailView) {
        detailView.value.closeView()
      }
    })

    const showDetailView = (option) => {
      detailView.value.refreshData(option)
    }

    return {
      detailView,

      showDetailView,
    }
  },
})
</script>

<style lang="scss">
/* 引入初始化样式 */
@import "@/style/main.scss";
@import "@/style/base.scss";
@import "@/style/mobile.scss";
#app {
  background: #eee;
  overflow: hidden;
  font-weight: 400 !important;
}
.el-button {
  font-weight: 400 !important;
}
</style>
